package it.anyplace.anyspeed;

import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.widget.TextView;

public class MirrorTextView extends TextView {

	private boolean isMirror = false;

	public MirrorTextView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public void setMirror(boolean isMirror) {
		this.isMirror = isMirror;
	}

	public boolean getMirror() {
		return isMirror;
	}

	@Override
	protected void onDraw(Canvas canvas) {
		if (isMirror) {
			canvas.translate(getWidth(), 0);
			canvas.scale(-1, 1);
		}
		super.onDraw(canvas);
	}

}
